// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-8-20

#ifndef __FACEPOP_H_CLIENT_MAIN__
#define __FACEPOP_H_CLIENT_MAIN__

#pragma once

#include <common\ui\wndcontainer.h>
#include <richole.h>

class CJoyFacePop;
class CJoyBitmapData;

//##ModelId=44C4B5E30157
class CJoyFacePop :
    public CJoyWndContainer
{
	DECLARE_DYNAMIC(CJoyFacePop)
public:
protected:
	//##ModelId=44C4B5E30168
    void FreeFaces();

	//##ModelId=44C4B5E30169
    virtual void CM_Mouse(MouseMessage msg, const CPoint& pt);
	//##ModelId=44C4B5E30179
    virtual void CM_LoadSkin(CJoyXmlElement* pSkinElem);
	//##ModelId=44C4B5E3017C
    virtual void CM_Draw(Graphics& graph);
public:
	//##ModelId=44C4B5E30187
    int m_faceSel;
	//##ModelId=44C4B5E30188
    int m_faceRow;
	//##ModelId=44C4B5E30189
    int m_faceCol;
	//##ModelId=44C4B5E3018A
    int m_faceWidth;
	//##ModelId=44C4B5E30196
    int m_faceHeight;
	//##ModelId=44C4B5E30198
    Color   m_hoverColor;

	//##ModelId=44C4B5E3019D
    CArray<CJoyBitmapData*> m_faces;

	//##ModelId=44C4B5E301A6
    CJoyImagePtr    m_image;

	//##ModelId=44C4B5E301AA
    CJoyFacePop(void);
	//##ModelId=44C4B5E301AC
    virtual ~CJoyFacePop(void);

	//##ModelId=44C4B5E301B5
    bool Create();
	//##ModelId=44C4B5E301B6
    void Show(const CPoint& pt);
	//##ModelId=44C4B5E301B8
    void InsertFace(LPRICHEDITOLE lpRichOle, int nFace);

public:
    DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B5E301C6
    afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	//##ModelId=44C4B5E301D4
    afx_msg void OnSetFocus(CWnd* pOldWnd);
	//##ModelId=44C4B5E301D7
    afx_msg void OnKillFocus(CWnd* pNewWnd);
	//##ModelId=44C4B5E301DA
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//##ModelId=44C4B5E301E5
    afx_msg void OnSize(UINT nType, int cx, int cy);
	//##ModelId=44C4B5E301EA
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};

#endif  // __FACEPOP_H_CLIENT_MAIN__
